<?php
$this->breadcrumbs=array(
	'Orders'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List Order', 'url'=>array('index')),
	array('label'=>'Create Order', 'url'=>array('create')),
	array('label'=>'Update Order', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Order', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Order', 'url'=>array('admin')),
);
?>

<h1>View Order #<?php echo $model->id; ?></h1>
<?php

    $sender = '';
if($model->attributes['sender'] == 0){
    $sender_id = 2;
    $sender = 'ไม่ได้ระบุ';
}else{
    $sender_id = $model->attributes['sender'];
    $Dealers = Dealers::model()->findByPk($sender_id);
    $sender = $Dealers->attributes['name'];
}

?>
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'create_time',
        'update_time',
        array(
            'name'=>'sender',
            'value'=>$sender
        ),
		'customer',
		'address',
		'products',
		'transferred',
		'bank',
		'date_trans',
		'status',
        'ems',
		'note',
	),
)); ?>